const{  Movie,  Music, Sentence} = require('./classic')

class Art {
  constructor(art_id, type) {
    this.art_id = art_id
    this.type = type
  }
  static async getData(art_id, type) {
    let art = null
    const finder = {
      where: {
        id: art_id
      }
    }

    const actions = {
      100: async () => {
        return Movie.findOne(finder)
      },
      200: async () => {
        return Music.findOne(finder)
      },
      300: async () => {
        return Sentence.findOne(finder)
      },
      400: async () => {  // book

      },
      'default': () => {

      }
    } 

    art = await actions[type]()
    return art
  }
}

module.exports = {
  Art
}